<table class="ctable" id="dsRoom" width="100%">
<?php
session_start();
$room_id=$_REQUEST['room_id'];
$room_name=$_REQUEST['room_name'];
$page=$_REQUEST['page'];
$per_page=$_REQUEST['per_page'];
$per_page=5;
include_once '../../Model/Room.php';
$room= new Room();
$rs=$room->get_list_room($room_id,$room_name,1,$page,$per_page);
if($rs!=NULL){
$result='';
$action='';
 for($i=0;$i<count($rs);$i++){
	 	$j=$i+1;
		if($rs[$i][5]==NULL){
			$rs[$i][5]="lib/images/phonghop.jpg";
		}
		$result=$result.'<td width="20%"><div class="subContent">
  		  <a href="javascript:open_user_room(\''.$rs[$i][0].'\')" ><img src="'.$rs[$i][5].'" style="margin-left: 5%;margin-right: 5%;text-align:center;width:85%;height:120px; "/><br>
		  <font color="#000000">'.$rs[$i][1].'</font></a></div></td>';
		$action=$action.'<td width="20%"><div id="control_'.$j.'" class="viewAction">
		<input type="button" name="btnView" class="cbutton" id="btnView" value="予約リスト" onclick="open_user_room(\''.$rs[$i][0].'\')"/>
		<input type="button" name="btnPut" class="cbutton" id="btnPut" value="予約" onclick="book_room(\''.$rs[$i][0].'\')"/>
		</div></td>';
		/*<!-- 
		<a href="javascript:open_user_room(\''.$rs[$i][0].'\')" title="Xem thông tin người dùng đặt phòng"><img src="lib/images/open.gif"></a>
		<a href="javascript:book_room(\''.$rs[$i][0].'\')" title="Đặt phòng"><img src="lib/images/icon_check.jpg"></a>-->*/
}
for($i=5;$i>count($rs);$i--){
	$result=$result."<td width='20%'></td>";
}
$result='<tr>'.$result.'</tr>';
$action='<tr>'.$action.'</tr>';
$result=$result.$action;
echo $result;
}
?>
</table>